<?php

declare (strict_types=1);
namespace App\Model;

use Hyperf\Database\Model\SoftDeletes;
/**
 * @property int $id 主键
 * @property string $type 分类
 * @property int $company_id 单位ID
 * @property string $title 方案标题
 * @property string $content 内容
 * @property string $remark 备注
 * @property int $status 状态1正常2禁用
 * @property int $sort 排序
 * @property int $created_user 创建人
 * @property \Carbon\Carbon $created_at 创建时间
 * @property \Carbon\Carbon $updated_at
 * @property string $deleted_at 软删除
 */
class Article extends BaseModel
{
    use SoftDeletes;
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'articles';
    protected $hidden = ['deleted_at'];
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['id', 'type', 'mid','tid', 'title', 'content', 'remark', 'status', 'sort', 'created_user', 'created_at', 'updated_at', 'deleted_at'];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = ['id' => 'int', 'mid' => 'integer','tid' => 'integer', 'status' => 'integer', 'sort' => 'integer', 'created_user' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
    /**
     * [createuser 创建者]
     * @return [type] [description]
     */
    public function createuser()
    {
        return $this->hasOne(User::class, 'id', 'created_user');
    }
}